﻿using AutoMapper;
using Hx.ADSyncPlatform.ActiveDirectory.Model;
using Hx.ADSyncPlatform.Common.Excel;
using Hx.ADSyncPlatform.Common.ExportExcel;
using Hx.ADSyncPlatform.Common.ExportExecl;
using Hx.ADSyncPlatform.Entity.Entities;
using Hx.ADSyncPlatform.Entity.Models;
using Hx.ADSyncPlatform.WebApi.Model;

namespace Hx.ADSyncPlatform.AutoMapper
{
    /// <summary>
    /// 
    /// </summary>
    public class CustomProfile : Profile
    {
        /// <summary>
        /// 
        /// </summary>
        public CustomProfile()
        {

            CreateMap<Plat_SysManager, Plat_SysManagerViewModel>();
            CreateMap<Plat_SysManagerViewModel, Plat_SysManager>();
            CreateMap<Plat_SysRole, Plat_SysRoleViewModel>();
            CreateMap<Plat_SysRoleViewModel, Plat_SysRole>();
            CreateMap<CreateOrUpdatePlatManagerRequest, Plat_SysManager>();
            CreateMap<Organization, ExportOrganizationModel>();
            CreateMap<Group, ExportGroupModel>();
            CreateMap<Person, ExportPersonModel>();
            CreateMap<Computer, ExportComputerModel>().ForMember(dest => dest.isBind, opt => opt.MapFrom(s => s.Binded ? "是" : "否"));
            CreateMap<Computer, ExportComputerBaseModel>();
        }
    }
}
